<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>fputwc</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_005_212">&nbsp;</a>NAME</h4><blockquote>
fputwc - put a wide-character code on a stream
</blockquote><h4><a name = "tag_000_005_213">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="stdio.h.html">stdio.h</a>&gt;
#include &lt;<a href="wchar.h.html">wchar.h</a>&gt;

wint_t fputwc(wchar_t <i>wc</i>, FILE *<i>stream</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_000_005_214">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>fputwc()</i>
function writes the character corresponding to the wide-character code
<i>wc</i>
to the output stream pointed to by
<i>stream</i>,
at the position indicated by the associated file-position
indicator for the stream (if defined), and advances the indicator
appropriately.
If the file cannot support positioning requests, or if the stream
was opened with append mode, the character is appended to the
output stream.  If an error occurs whilst writing the character, the shift
state of the output file is left in an undefined state.
<p>
The
<i>st_ctime</i>
and
<i>st_mtime</i>
fields of the file will be marked for update between the successful
execution of
<i>fputwc()</i>
and the next successful completion of a call to
<i><a href="fflush.html">fflush()</a></i>
or
<i><a href="fclose.html">fclose()</a></i>
on the same stream or a call to
<i><a href="exit.html">exit()</a></i>
or
<i><a href="abort.html">abort()</a></i>.
</blockquote><h4><a name = "tag_000_005_215">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon successful completion,
<i>fputwc()</i>
returns
<i>wc</i>.
Otherwise, it returns WEOF, the error indicator for the stream is set, and
<i>errno</i>
is set to indicate the error.
</blockquote><h4><a name = "tag_000_005_216">&nbsp;</a>ERRORS</h4><blockquote>
The
<i>fputwc()</i>
function will fail if either the stream is unbuffered or data in the
<i>stream</i>'s
buffer needs to be written, and:
<dl compact>

<dt>[EAGAIN]<dd>
The O_NONBLOCK flag is set for the file descriptor
underlying
<i>stream</i>
and the process would be delayed in the write operation.

<dt>[EBADF]<dd>
The file descriptor underlying
<i>stream</i>
is not a valid file descriptor open for writing.

<dt>[EFBIG]<dd>
An attempt was made to write to a file that exceeds
the maximum file size or the process' file size limit.

<dt>[EFBIG]<dd>
The file is a regular file and an attempt was made to write at or beyond
the offset maximum associated with the corresponding stream.

<dt>[EINTR]<dd>
The write operation was terminated due to the
receipt of a signal, and no data was transferred.

<dt>[EIO]<dd>
A physical I/O error has occurred, or
the process is a member
of a background process group attempting to write to its
controlling terminal, TOSTOP is set, the process is neither ignoring nor
blocking SIGTTOU and the process group of the process is
orphaned.
This error may also be returned under implementation-dependent conditions.

<dt>[ENOSPC]<dd>
There was no free space remaining on the device containing
the file.

<dt>[EPIPE]<dd>
An attempt is made to write to a pipe or FIFO that is not open
for reading by any process.
A SIGPIPE signal will also be sent to the thread.

</dl>
<p>
The
<i>fputwc()</i>
function may fail if:
<dl compact>

<dt>[ENOMEM]<dd>
Insufficient storage space is available.

<dt>[ENXIO]<dd>
A request was made of a non-existent device, or the request was
outside the capabilities of the device.

<dt>[EILSEQ]<dd>
The wide-character code
<i>wc</i>
does not correspond to a valid character.

</dl>
</blockquote><h4><a name = "tag_000_005_217">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_005_218">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_005_219">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_005_220">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="ferror.html">ferror()</a></i>,
<i><a href="fopen.html">fopen()</a></i>,
<i><a href="setbuf.html">setbuf()</a></i>,
<i><a href="ulimit.html">ulimit()</a></i>,
<i><a href="stdio.h.html">&lt;stdio.h&gt;</a></i>,
<i><a href="wchar.h.html">&lt;wchar.h&gt;</a></i>.
</blockquote><h4>DERIVATION</h4><blockquote>
Derived from the MSE working draft.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>

